﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Windows.Forms;
using CorsatAdminApp.Library.TempTaskClasses;

namespace CorsatAdminApp.Desktop.TempTaskForms
{
    public partial class AccountResult : Form
    {public AccountResult()
        {
            InitializeComponent();
        
        }
        #region private Methods

        #endregion

       private void BindData()
       {
           
       }

        public IList<Result> AccountResults { get; set; }
        public IList<Item> Items { get; set; }
        
        
        private void AccountResult_Load(object sender, EventArgs e)
        {
            CbxCourseTitle.DataSource = Items;
            CbxCourseTitle.DisplayMember = "ItemName";
            CbxCourseTitle.ValueMember = "ItemID";

            CbxLevel.DataSource = Items;
            CbxLevel.DisplayMember = "ItemName";
            CbxLevel.ValueMember = "ItemID";
        }

        private void CbxCourseTitle_SelectedIndexChanged(object sender, EventArgs e)
        {
            DGridResults.DataSource = AccountResults;
        }

        private void CbxLevel_SelectedIndexChanged(object sender, EventArgs e)
        {
            DGridResults.DataSource = AccountResults;
        }

        private void BtnLoad_Click(object sender, EventArgs e)
        {
            try
            {
                DGridResults.DataSource = AccountResults;
                BtnLoad.Enabled = false;
                BtnSave.Enabled = true;
            }
            catch (Exception)
            {
                MessageBox.Show(@"Error !");
            }
        }

        private void BtnSave_Click(object sender, EventArgs e)
        {
            try
            {
                
               
            }
            catch (Exception)
            {
                MessageBox.Show(@"Please,Select CourseTitle & Level be4 Save ur Data");
            }

        }
    }
}
